﻿<?php
class tree_main implements tree
{
	protected static $_zend_controller_action;
	protected static $_zend_db;
	protected $db;
	public function __construct(Zend_Controller_Action &$value ,&$db){
	  self::$_zend_controller_action = &$value;
	  self::$_zend_db = &$db;
	  self::main();
	}
	public static function main(){
		$select = self::$_zend_db->select();
		$select->from(MF_DB_PREFIX . 'channel','*');
        $sql = $select->__toString();
	    $result['tree'] = self::$_zend_db->fetchAll($sql);
		self::$_zend_controller_action->view->assign($result);
	    echo self::$_zend_controller_action->view->render ( 'tree/main.html' );  
	}
	
}